<doc>
  @author: 李百成
  @description： 文章页面
</doc>
<template>
  <div class="article-warp">
    {{ token }}
    <InfiniteList :listData="articleList"></InfiniteList>
  </div>
</template>

<script>
import InfiniteList from './infiniteList'
import { mapState, mapMutations } from 'vuex'
export default {
  name: 'detail',
  components: {
    InfiniteList,
  },
  props: {},
  data () {
    return {
      articleList: [],
    }
  },

  computed: {
    ...mapState(['token']),
  },
  created () {
    this.getArticleList()
    if (this.$route.params.id === '1') this.setToken(this.$route.params.id)
  },
  mounted () {},
  methods: {
    ...mapMutations(['setToken']),
    getArticleList () {
      this.articleList = [...Array(100).keys()].map(item => ({ id: item, name: `李柏成-${item + 1}` }))
    },
  },
}
</script>

<style lang="less">
.article-warp {
  width: 50vw;
  height: 70vh;
  border: 3px solid palevioletred;
}
</style>
